package com.cyf.xjtech_android.bean;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * Created by kevin on 2019/12/1.
 */

public class TmpData {
    private int width;
    private int height;
    /**
     * RGBA的图像数据
     * 建议转换方式为
     * Bitmap bmp = Bitmap.createBitmap(tmpData.width, tmpData.height, Bitmap.Config.ARGB_8888)
     * ByteBuffer buffer = ByteBuffer.wrap(tmpData.bmp)
     * bmp.copyPixelsFromBuffer(buffer)
     */
    private byte[] bmp;  //位图数据

    private short[] meas;//测温数据

    /**
     * 全屏最高温坐标
     */
    private int maxX = 0;                    ///< 最高温X
    private int maxY = 0;                    ///< 最高温Y

    /**
     * 全屏最低温坐标
     */
    private int minX = 0;                    ///< 最低温X
    private int minY = 0;                    ///< 最低温Y

    private float max = 0;                    ///< 最高温
    private float min = 0;                    ///< 最低温
    private float avg = 0;                    ///< 平均温

    public TmpData(int w, int h) {
        bmp = new byte[w * h * 4];
        meas = new short[w * h];
        width = w;
        height = h;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public byte[] getBmp() {
        return bmp;
    }

    public void setBmp(byte[] bmp) {
        this.bmp = bmp;
    }

    public int getMaxX() {
        return maxX;
    }

    public void setMaxX(int maxX) {
        this.maxX = maxX;
    }

    public int getMaxY() {
        return maxY;
    }

    public void setMaxY(int maxY) {
        this.maxY = maxY;
    }

    public int getMinX() {
        return minX;
    }

    public void setMinX(int minX) {
        this.minX = minX;
    }

    public int getMinY() {
        return minY;
    }

    public void setMinY(int minY) {
        this.minY = minY;
    }

    public float getMax() {
        return max;
    }

    public void setMax(float max) {
        this.max = max;
    }

    public float getMin() {
        return min;
    }

    public void setMin(float min) {
        this.min = min;
    }

    public float getAvg() {
        return avg;
    }

    public void setAvg(float avg) {
        this.avg = avg;
    }

    public short[] getMeas() {
        return meas;
    }

    public void setMeas(short[] meas) {
        this.meas = meas;
    }

    @Override
    public String toString() {
        return "TmpData{" +
                "width=" + width +
                ", height=" + height +
                ", bmp=" + Arrays.toString(bmp) +
                ", meas=" + Arrays.toString(meas) +
                ", maxX=" + maxX +
                ", maxY=" + maxY +
                ", minX=" + minX +
                ", minY=" + minY +
                ", max=" + max +
                ", min=" + min +
                ", avg=" + avg +
                '}';
    }
}
